#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>

int main(){
    
    umask(0);
    int fd = open("myfiles", O_WRONLY|O_CREAT, 0644);
    if(fd < 0){
        perror("file_creat_error!!!");
        exit(1);
    }

    int count = 5;
    const char *msg ="hello linux\n";
    int len =strlen(msg);
    while(count > 0){
        write(fd, msg, len);
        count--;
    }

    return 0;
}
